package org.handyc.game.resource;

import javax.swing.ImageIcon;

public class GameResource {

	public static void main(String... args) {
		System.out.println(GameResource.class.getResource("/").getFile());
	}

	private GameResource() {
	};

	private static GameResource gameResource = null;

	private static GameResource getGameResource() {
		if (null == gameResource) {
			gameResource = new GameResource();
		}
		return gameResource;
	}

	private ImageIcon _getImageIcon(String path) {
		ImageIcon icon = null;
		String resourcePath = getClass().getResource("/").getFile() + path;
		icon = new ImageIcon(resourcePath);
		return icon;
	}

	public static ImageIcon getImageIcon(String path) {
		return getGameResource()._getImageIcon(path);
	}

}
